export function showTime(d: number = Date.now()) {
  const date = new Date(d)
  const Year = date.getFullYear()
  const Mon = date.getMonth() + 1
  const Day = date.getDate()

  const Hour = date.getHours()
  const Min = date.getMinutes()
  const Sec = date.getSeconds()
  //   2024/12/24 15:26:33<
  // return Year + "/" + Mon + "/" + Day + " " + Hour + ":" + Min + ":" + Sec
  return `${Year}/${format(Mon)}/${format(Day)} ${format(Hour)}:${format(
    Min
  )}:${format(Sec)}`
}

function format(n: number) {
  // return ("" + n).length == 1 ? "0" + n : "" + n
  // String.prototype.padStart(length, 内容)
  return String(n).padStart(2, "0")
}
